import { createRouter, createWebHistory } from 'vue-router'
import HomePage from '@/components/Home_page.vue'
import LogIn from '@/components/Log_in.vue'
import SignUp from '@/components/Sign_up.vue'
import Browse from '@/components/Browse_book.vue'
// import Profile from '@/components/Profile.vue'
import PersonalHomepage from '@/components/Personal_homepage.vue'
import AddBook from '@/components/AddBook.vue'; // 增加书籍组件
import DeleteBook from '@/components/DeleteBook.vue'; // 删除书籍组件
import EditBook from '@/components/EditBook.vue'; // 修改书籍组件
import ForgotPassword from '@/components/Forgot_password.vue'; // 修改书籍组件


const routes = [
  {
    path: '/',
    name: 'home',
    component: HomePage,
    props:true,
  },
  {
    path: '/login',
    name: 'login',
    component: LogIn,
    props:true,
  },
  {
    path: '/signup',
    name: 'signup',
    component: SignUp,
    props:true,
  },
    {
    path: '/personal_homepage',
    name: 'personal_homepage',
    component: PersonalHomepage,
    props:true,
  },
  
  {
    path: '/browse',
    name: 'browse',
    component: Browse,
    props:true,
  },
    {
      path: '/add-book',
      name: 'add-book',
      component: AddBook
    },
    {
      path: '/delete-book',
      name: 'delete-book',
      component: DeleteBook
    },
    {
      path: '/edit-book',
      name: 'edit-book',
      component: EditBook
    },
    {
      path: '/forgot-password',
      name: 'forgot-password',
      component: ForgotPassword
    },
]

const router = createRouter({
  history: createWebHistory(),
  routes
})

export default router